ScxV6Object.Name Method
Gets or sets the name of the database object
Parameters
- NewName
The new name of the object
Remarks
When written to the Name property will attempt to rename a database object. The operation may fail if:
- The user does not have configuration privileges for the object.
- An existing object with the same name already exists in the parent group of the object.
- The NewName argument contains invalid characters, for example a full stop.
The following example written in VB.NET changes the name of an analogue point, and outputs the name before and after to the console:
Dim Svr As ScxV6DbClient.ScxV6Server
' Connect to the server
Svr = New ScxV6DbClient.ScxV6Server
Svr.Connect("MAIN", "", "")
Dim Obj As ScxV6DbClient.ScxV6Object
Obj = Svr.FindObject("Group.Sub-Group.New Analogue Point")
Console.WriteLine("The old name of the object is ""{0}""", Obj.FullName)
Obj.Name = "New Point Name"
Console.WriteLine("The new name of the object is ""{0}""", Obj.FullName)
' Disconnect
Svr.Disconnect()
This produces the following output:
The old name of the object is "Group.Sub-Group.New Analogue Point"
The new name of the object is "Group.Sub-Group.New Point Name"